<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .a {
        color: red;
      }
      .b {
        color: green;
      }
      .c {
        font-size: 30px;
        background: red;
      }
    </style>
  </head>
  <body>
    <div class="c" userdata="张三" id="box" name="op">11111111111</div>
    <div>222222222222</div>
    <div class="n" name="op">333333333333333</div>
    <button class="n" id="btn">阿珂金黄色的见客户</button>
    <input type="text" id="inp" value="" />
    <script>
      box.onclick = function () {
        inp.value = 9999;
      };
      //   let btn = document.getElementById("box");
      //   console.log(btn.innerHTML);
      // let obj = document.getElementsByTagName("div");
      //   console.log(obj[1].innerHTML);
      //   let obj = document.getElementsByClassName("n");
      //   console.log(obj);
      //   let obj2 = document.querySelectorAll("div");
      //   console.log(obj2);
      //   for (let i = 0; i < obj.length; i++) {
      //     obj[i].innerHTML = "*************";
      //   }
      // console.log([...obj]);
      // [...obj].forEach((item) => {
      //   console.log(item);
      //   item.innerHTML = "XXXXXXXXXXXXXX";
      // });
      // console.log(document.body);
      // document.body.style = "background-color:red";
      // document.body.style.backgroundColor = "blue";
      document.querySelector("button").onclick = function () {
        // document.querySelector("input").value = "8888";
        // document.querySelector("input").remove();
        // document.getElementsByName("op")[0].innerText = "<h1>888888888888</h1>";
        // let val = document.querySelector("input").value;
        // let val = document
        //   .getElementById("box")
        //   .setAttribute("userdata", "李四");
        // console.log(val);
        // document.getElementById("box").className = "b";
        // document.getElementById("box").classList.toggle("c");
        let v = document.getElementById("box");
        let h = window.getComputedStyle(v).height;
        v.style.height = parseInt(h) + 100 + "px";
      };
    </script>
  </body>
</html>
